﻿
function CheckUserSearch()
{
    ClearTextTrim();
    $("BtnSearch").click();  
}

function ClearUserSearch()
{
    $("TxtAcount").value = "";
    $("TxtUserName").value = "";
    $("TxtCompany").value = "";
    $("TxtDep").value = "";
    $("TxtRole").value = "";
    $("TxtCreater").value = "";
    $("DDLLock").selectedIndex = 0;
}

function ClearTextTrim()
{
    $("TxtAcount").value = $("TxtAcount").value.Trim();
    $("TxtUserName").value = $("TxtUserName").value.Trim();
    $("TxtCompany").value = $("TxtCompany").value.Trim();
    $("TxtDep").value = $("TxtDep").value.Trim();
    $("TxtRole").value = $("TxtRole").value.Trim();
    $("TxtCreater").value = $("TxtCreater").value.Trim();
}

function DataSort(columnCode)
{
    if($("Txt_order").value == "asc")
        $("Txt_order").value = "desc";
    else
        $("Txt_order").value = "asc";
    $("Txt_temp").value = " order by " + columnCode + " " + $("Txt_order").value + " ";
    $("Button4").click();
}

function DeteleDataByAcount(sAcount)
{
    if(confirm("确定要删除吗？"))
    {
        $("Txt_temp").value=sAcount;
        $("Button6").click();
    }
}

function DeteleDataByAcounts()
{
    obj = $$("chk_item");
    values = "";
    for(i=0;i<obj.length;i++)
    {
        if(obj[i].checked)
            values += obj[i].value+";";
    }
    if(values == "")
    {
        alert("请选择要删除的用户选项！");
        return;
    }
    values = values.substring(0,values.length-1);
    DeteleDataByAcount(values);
}


 function OpenUserDetails(userAcount) {
//     var result = window.showModalDialog("UserEdit.aspx?Acount=" + userAcount, "", "dialogHeight:550px; dialogWidth:450px; toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no,help = no, status=no, toolbar=no");
        var result = window.showModalDialog("M_User_Details.aspx?Acount="+userAcount,"","dialogHeight:100%; dialogWidth:100%; toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no,help = no, status=no, toolbar=no");
        if(result != undefined)
        {
//            if(result!="No")
//            {
                $("BtnSearch").click();
//            }
        }
    }

//文心借用
    //robin.......
    function Link(userAcount) {
        window.location.href = "UserEdit.aspx?Acount=" + userAcount;
    }
 